package service.beans;

public class ArticleServiceProxy implements service.beans.ArticleService_PortType {
  private String _endpoint = null;
  private service.beans.ArticleService_PortType articleService_PortType = null;
  
  public ArticleServiceProxy() {
    _initArticleServiceProxy();
  }
  
  public ArticleServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initArticleServiceProxy();
  }
  
  private void _initArticleServiceProxy() {
    try {
      articleService_PortType = (new service.beans.ArticleService_ServiceLocator()).getArticleServicePort();
      if (articleService_PortType != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)articleService_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)articleService_PortType)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (articleService_PortType != null)
      ((javax.xml.rpc.Stub)articleService_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public service.beans.ArticleService_PortType getArticleService_PortType() {
    if (articleService_PortType == null)
      _initArticleServiceProxy();
    return articleService_PortType;
  }
  
  public service.beans.Article[] getArticles() throws java.rmi.RemoteException{
    if (articleService_PortType == null)
      _initArticleServiceProxy();
    return articleService_PortType.getArticles();
  }
  
  public service.beans.Article getArticle(int id) throws java.rmi.RemoteException, service.beans.ArticleNotFoundException{
    if (articleService_PortType == null)
      _initArticleServiceProxy();
    return articleService_PortType.getArticle(id);
  }
  
  
}